﻿-- Author  : Kurapica
-- Create Date : 2009/10/12

--[[
	In-Game Addon System
	Studio Part		
	Menu
--]]
do
	IGAS:NewAddon("IGAS_Studio")
	
	-- Menu
	local menu = CreateFrame(Widget.MenuStrip, "Menu", coreF)
	
	-- New
	local mnuNewAddon = menu:AddMenuItem(L["File"], L["New"], L["Addon"])
	local mnuExit = menu:AddMenuItem(L["File"], L["Exit"])
	
	function mnuNewAddon:OnClick()
		self:FireEvent("IGAS_STUDIO_ADDONINFO_REQUIRE", nil)
	end
	
	function mnuExit:OnClick()
		UIParent:Show()
		coreF.Visible = false
	end
	
	-- Save
	local mnuSave = menu:AddMenuItem(L["Save"], L["Save Current"])
	local mnuSaveAll = menu:AddMenuItem(L["Save"], L["Save All"])
	
	function mnuSave:OnClick()
		self:FireEvent("IGAS_STUDIO_SAVE_FILE")
	end
	
	function mnuSaveAll:OnClick()
		self:FireEvent("IGAS_STUDIO_SAVE_FILE", true)
	end
	
	-- Tool
	local menuPointTool = menu:AddMenuItem(L["Tool"], L["Anchor Point"])
	
	function menuPointTool:OnClick()
		if coreF.Marker and coreF.Marker.MarkedFrame and coreF.Marker.InMarkMode then
			return self:FireEvent("IGAS_STUDIO_SET_POINT", coreF.Marker.MarkedFrame)
		end
	end
	
	-- Help
	local About_Me = menu:AddMenuItem(L["Help"], L["About Me"])
	
	function About_Me:OnClick()
		if coreF.About_Me then
			coreF.About_Me.Visible = true
		end
	end
end
